// COMP710 GP Framework 2025
// Library includes:
#ifdef _DEBUG
#define new  new(_CLIENT_BLOCK, __FILE__, __LINE__)
#define _CRTDBG_MAP_ALLOC
#include <crtdbg.h>
#endif

#include <SDL.h>
// Local includes:
#include "game.h"
#include "logmanager.h"

int main(int argc, char* argv[])
{
	_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);//detect memory leak 
	
	Game& gameInstance = Game::GetInstance();
	if (!gameInstance.Initialize())
	{
		LogManager::GetInstance().Log("Game initialize failed!");

		return 1;
	}

	while (gameInstance.DoGameLoop())
	{
		// No body.
	}

	Game::DestroyInstance();
	LogManager::DestroyInstance();

	return 0;
}